/*
 * Class50_Sub1_Sub4_Sub2 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
final class Class50_Sub1_Sub4_Sub2 extends Class50_Sub1_Sub4 {
	private SpotAnimation aSpotAnimation_1553;
	public int anInt1554;
	public double aDouble1555;
	public double aDouble1556;
	public double aDouble1557;
	public int anInt1558;
	public int anInt1559;
	public int anInt1560;
	private boolean aBoolean1561 = false;
	public int anInt1562;
	public int anInt1563;
	private byte aByte1564 = -41;
	public int anInt1565;
	public int anInt1566;
	private int anInt1567;
	private int anInt1568;
	private double aDouble1569;
	private double aDouble1570;
	private double aDouble1571;
	private double aDouble1572;
	private boolean aBoolean1573 = true;
	private double aDouble1574;
	public boolean aBoolean1575 = false;
	public int anInt1576;
	public int anInt1577;
	public int anInt1578;
	public int anInt1579;

	public final void method573(int i, int i_0_, int i_1_, int i_2_, int i_3_) {
		if (!aBoolean1575) {
			double d = (i - anInt1576);
			double d_4_ = (i_0_ - anInt1577);
			double d_5_ = Math.sqrt(d * d + d_4_ * d_4_);
			aDouble1555 = anInt1576 + d * anInt1559 / d_5_;
			aDouble1556 = anInt1577 + d_4_ * anInt1559 / d_5_;
			aDouble1557 = anInt1578;
		}
		double d = (anInt1566 + 1 - i_2_);
		aDouble1569 = (i - aDouble1555) / d;
		aDouble1570 = (i_0_ - aDouble1556) / d;
		if (i_3_ == 0) {
			aDouble1571 = Math.sqrt(aDouble1569 * aDouble1569 + aDouble1570 * aDouble1570);
			if (!aBoolean1575) {
				aDouble1572 = -aDouble1571 * Math.tan(anInt1558 * 0.02454369);
			}
			aDouble1574 = 2.0 * (i_1_ - aDouble1557 - aDouble1572 * d) / (d * d);
		}
	}

	public final void method574(int i, boolean bool) {
		aBoolean1575 = true;
		aDouble1555 += aDouble1569 * i;
		if (bool) {
			for (int i_6_ = 1; i_6_ > 0; i_6_++) {
				/* empty */
			}
		}
		aDouble1556 += aDouble1570 * i;
		aDouble1557 += (aDouble1572 * i + 0.5 * aDouble1574 * i * i);
		aDouble1572 += aDouble1574 * i;
		anInt1562 = ((int) (Math.atan2(aDouble1569, aDouble1570) * 325.949) + 1024 & 0x7ff);
		anInt1563 = (int) (Math.atan2(aDouble1572, aDouble1571) * 325.949) & 0x7ff;
		if (aSpotAnimation_1553.sequence != null) {
			anInt1568 += i;
			while (anInt1568 > aSpotAnimation_1553.sequence.method205(0, anInt1567)) {
				anInt1568 -= aSpotAnimation_1553.sequence.method205(0, anInt1567);
				anInt1567++;
				if (anInt1567 >= aSpotAnimation_1553.sequence.anInt294) {
					anInt1567 = 0;
				}
			}
		}
	}

	@Override
	public final Model method572(byte i) {
		Model model = aSpotAnimation_1553.method307();
		if (model == null) {
			return null;
		}
		int i_7_ = -1;
		if (aSpotAnimation_1553.sequence != null) {
			i_7_ = aSpotAnimation_1553.sequence.anIntArray295[anInt1567];
		}
		Model model_8_ = new Model(false, false,
			true, model, Class21.method239(i_7_));
		if (i_7_ != -1) {
			model_8_.method595(7);
			model_8_.method596(i_7_, (byte) 6);
			model_8_.anIntArrayArray1679 = null;
			model_8_.anIntArrayArray1678 = null;
		}
		if (aSpotAnimation_1553.anInt561 != 128 || aSpotAnimation_1553.anInt562 != 128) {
			model_8_.method604(aSpotAnimation_1553.anInt562, aSpotAnimation_1553.anInt561, 9,
				aSpotAnimation_1553.anInt561);
		}
		model_8_.method600(anInt1563, 341);
		model_8_.preProcess(aSpotAnimation_1553.anInt564 + 64,
			aSpotAnimation_1553.anInt565 + 850, -30, -50, -30, true);
		if (i == 3) {
		} else {
			aBoolean1561 = !aBoolean1561;
		}
		return model_8_;
	}

	public Class50_Sub1_Sub4_Sub2(int i, int i_9_, int i_10_, int i_11_, int i_12_, int i_13_,
		int i_14_, int i_15_, byte i_16_, int i_17_, int i_18_, int i_19_) {
		aSpotAnimation_1553 = SpotAnimation.spotAnims[i_12_];
		anInt1554 = i;
		anInt1576 = i_18_;
		anInt1577 = i_11_;
		anInt1578 = i_17_;
		anInt1565 = i_19_;
		anInt1566 = i_13_;
		if (i_16_ != aByte1564) {
			throw new NullPointerException();
		}
		anInt1558 = i_14_;
		anInt1559 = i_10_;
		anInt1560 = i_15_;
		anInt1579 = i_9_;
		aBoolean1575 = false;
	}
}
